<?php include'views/templates/layouts/'.$this->layout.'/header.php'; ?>
    <!--Messager-->
<?php
$messager="true";
if($messager!="")
{
    ?>
    <br>
    <div class="alert alert-success">
        <button class="close" data-dismiss="alert">×</button>
        <strong>Success!</strong> The page has been added.
    </div>
<?php
}
?>

    <!--End Messager-->
    <div class="widget-box">
        <div class="widget-title">

            <h5>List repost</h5>
            <h5> <a href="index.php?controller=articles&action=add">Add record!</a></h5>
        </div>
        <div class="widget-content nopadding">
            <table class="table table-bordered table-striped table-hover data-table">
                <thead>
                <tr>
                    <th>FileName</th>
                    <th>Description</th>
                    <th>Categoties</th>
                    <th>Action</th>
                </tr>
                </thead>
                <tbody>
                <?php
                if($list==null){
                    echo "<p>Dữ liệu trống</p>";
                }
                else{
                while($row = mysqli_fetch_array($list))
                {

                    ?>
                    <tr class="gradeX">
                        <td><?php echo $row['filename']; ?></td>
                        <td><?php echo $row['des']; ?></td>
                        <td><?php switch ($row['id_catfile'])
                            {
                                case "10":
                                    echo "RAR";
                                    break;
                                case "11":
                                    echo "Image";
                                    break;
                                default:
                                    echo "No specify";
                            } ?></td>
                        <td class="taskOptions">
                            <a href="#" class="tip-top" data-original-title="View"><i class="icon-th"></i></a>
                            <a href="index.php?controller=FileUploads&action=edit&id=<?php echo $row['id']; ?>" class="tip-top" data-original-title="Edit"><i class="icon-edit"></i></a>
                            <a href="index.php?controller=FileUploads&action=delete&id=<?php echo $row['id']; ?>" class="tip-top" data-original-title="Delete"><i class="icon-remove"></i></a>
                        </td>
                    </tr>
                <?php
                }}
                ?>
                </tbody>
            </table>
        </div>
    </div>
    </div>
    </div>


<?php include'views/templates/'.$this->layout.'/footer.php'; ?>